/* 共用的接口 */
import {
  baseURL,
  config
} from "../config.js";
import {
  getAction,
  postAction,
  putAction,
  deleteAction,
} from "../utils/request.js";
// 用户信息解密;
const userDecrypt = (params) =>
  postAction("/mini/sys/operate/user_decrypt", params);

//登录
const wxLogin = (params) => postAction("/mini/sys/operate/login", params);

// 拼接图片前缀 / 字典
const findEnableDictItemsbyCode = (code) => {
  let params = {
    code,
  };
  return getAction(`/common/sys/dict/find_enable_dict_items_by_code`, params);
};

export const ajaxGetDictItems = (params) =>
  getAction(`/common/sys/dict/find_enable_dict_items_by_code`, params);
// 获取所有数据字典
const findAllDict = (params) => getAction(`/common/sys/dict/find_all_dict`);

//退出登录
const logout = (params) =>
  postAction("/mini/sys/dict/find_all_dict/sys/operate/logout", params);

//修改密码
const editPWD = (params) =>
  putAction("/mini/appPolice/user/updatePassword", params);

// 检测照片
const userCheckPic = (params) => postAction("/mini/user/checkPic", params);

//消息条数
const getRed = (params) => getAction("/appPolice/message/getRed", params);

export const getHouseList = (params) =>
  getAction("/indeed/house/houseList", params);
export const getUnitsDetailsInfo = (params) =>
  getAction("/indeed/house/unitsDetailsInfo", params);
export const addPersonInfo = (params) =>
  postAction("/indeed/population/addPersonInfo", params);
export const getIdPersonInfo = (params) =>
  getAction("/indeed/population/getIdPersonInfo", params);
export const selectPoliceHouseMain = (params) =>
  getAction("/indeed/house/selectPoliceHouseMain", params);
export const setisMainId = (params) =>
  postAction("/indeed/house/setisMainId", params);
export const deletePoliceHouseMain = (params) =>
  getAction("/indeed/house/deletePoliceHouseMain", params);
export const updatePersonInfo = (params) =>
  postAction("/indeed/population/updatePersonInfo", params);
export const deletePersonInfo = (params) =>
  postAction("/indeed/population/deletePersonInfo", params);

export const rentinghouseHouseList = (params) =>
  getAction("/rentinghouse/houseList", params);

export const houseMapPoints = (params) => getAction(`/${config.role}/indeed/house/mapPoints`, params)


export const findAgencyCount = (params) => getAction('/police/check_unqualified/find_agency_count', params)
export const findWaitSignCount = (params) => getAction('/sys/document_company/find_wait_sign_count', params)
export const subordinateList = (params) => getAction('/common/commons/subordinateList', params)
export const sumCount = (params) => getAction('/mini/police/check_unqualified/sum_count', params)
export const upzdszJsonssInfo = (params) => postAction('/indeed/house/upzdszJsonssInfo', params)

export const FIND_TASK_PAGE = '/police/check_task/find_task_page'
export const WAIT_SIGN_PAGE = '/sys/document_company/wait_sign_page'
export const LIKE_UNITS_ROOM_LIST = '/common/area/likeUnitsRoomList'
export const FIND_AGENCY_PAGE = '/mini/police/check_task/find_agency_page'
export const HOUSE_LIST = '/indeed/house/houseList'
export const FIND_BASE_POLICE_PAGE = '/common/sys/police_agency/find_base_police_page'


// 特色功能
export const addPawnRecordDetails = (params) => postAction('/industry/addPawnRecordDetails', params)
export const addWasteRecyclingRecordDetails = (params) => postAction('/industry/addWasteRecyclingRecordDetails', params)
export const addPhoneRecyclingRecord = (params) => postAction('/industry/addPhoneRecyclingRecord', params)
export const addunlockRecord = (params) => postAction('/industry/addunlockRecord', params)

export const getPawnRecordDetails = (params) => getAction('/industry/getPawnRecordDetails', params)
export const getWasteRecyclingRecordDetails = (params) => getAction('/industry/getWasteRecyclingRecordDetails', params)
export const getIdPhoneRecyclingRecord = (params) => getAction('/industry/getIdPhoneRecyclingRecord', params)
export const getUnlockRecordById = (params) => getAction('/industry/getUnlockRecordById', params)
export const oilSaleAdd = (params) => postAction('/industry/oil_sale/add', params)
export const oilSaleRecordDetails = (params) => getAction('/industry/oil_sale/oilSaleRecordDetails', params)
export const selectHeadBybm = (params) => getAction('/indeed/house/selectHeadBybm', params)
export const getDepartAll = (params) => getAction('/common/commons/departAll', params)

export const getProvincecode = (params) => getAction('/common/commons/getProvinceCode', params)
export const houseTypeList = (params) => getAction('/indeed/house/houseTypeList', params)

export const getUnreadSum = (params) => getAction('/common/area/unreadSum', params)
export const registeredPhoneSave = (params) => postAction('mini/registered/phone/save', params)
export const electricvehiclesSave = (params) => postAction('mini/registered/electricvehicles/save', params)
export const phoneDetails = (params) => getAction('/mini/registered/phone/details', params)
export const phoneDeleteInfo = (params) => postAction('/mini/registered/phone/deleteInfo', params)
export const phoneLossReport = (params) => postAction('/mini/registered/phone/lossReport', params)
export const electricvehiclesDetails = (params) => getAction('/mini/registered/electricvehicles/details', params)
export const electricvehiclesDeleteInfo = (params) => postAction('mini/registered/electricvehicles/deleteInfo', params)
export const electricvehiclesLossReport = (params) => postAction('/mini/registered/electricvehicles/lossReport', params)
export const storagebatteryAcquisitionRecordsSave = (params) => postAction(
  '/mini/acquisition/storagebatteryAcquisitionRecords/save', params)
export const storagebatteryAcquisitionRecordsSaveDetails = (params) => getAction(
  '/mini/acquisition/storagebatteryAcquisitionRecords/details', params)
export const electricvehiclesAcquisitionRecordsSave = (params) => postAction(
  '/mini/acquisition/electricvehiclesAcquisitionRecords/save', params)
export const electricvehiclesAcquisitionRecordsDetails = (params) => getAction(
  'mini/acquisition/electricvehiclesAcquisitionRecords/details', params)

export const phoneAcquisitionRecordsSave = (params) => postAction('/mini/industry/phoneAcquisitionRecords/save', params)
export const phoneAcquisitionRecordsDetails = (params) => getAction('/mini/industry/phoneAcquisitionRecords/details',
  params)

export const phoneInvolvedQuery = (params) => getAction('/mini/registered/phone/involvedQuery', params)
export const electricvehicleslvedQuery = (params) => getAction('/mini/registered/electricvehicles/involvedQuery',
  params)
export const inspectionCategory = (params) => getAction('/fj/inspect/inspectionCategory', params)
export const getInspectionItems = (params) => getAction('/fj/inspect/examineIdItems', params)
export const getObtainAuxiliaryPolice = (params) => getAction('/fj/inspect/obtainAuxiliaryPolice', params)
export const setInspectionItems = (params) => postAction('/fj/inspect/generateCheckList', params)
export const inspectElectronicRecords = (params) => postAction('/fj/inspect/electronic_records', params)
export const inspectList = (params) => getAction('/fj/inspect/list', params)
export const inspectBindings = (params) => postAction('/fj/inspect/bindings', params)
export const inspectInspectionItems = (params) => getAction('/fj/inspect/inspectionItems', params)
export const submitInspectInspectionItems = (params) => postAction('/fj/inspect/inspectionItems', params)
export const taskVerificationCount = (params) => getAction('/fj/police/check_task/task_verification_count', params)
export const findTaskDetail = (params) => getAction('/fj/inspect/inspection/recheck', params)


export const helpinfoDetails = (params) => getAction('/mini/wb/helpinfo/details', params)

export const addWbHelpInfoRecords = (params) => postAction('/mini/wb/helpinforecords/addWbHelpInfoRecords', params)
export const monthHelpRecords = (params) => getAction('/mini/wb/helpinforecords/monthHelpRecords', params)
export const addWbMedicineRecords = (params) => postAction('/mini/wb/wbmedicinerecords/addWbMedicineRecords', params)
export const monthMedicineRecords = (params) => getAction('/mini/wb/wbmedicinerecords/monthMedicineRecords', params)

export const wbmedicinerecordsDetails = (params) => getAction('/mini/wb/wbmedicinerecords/details', params)
export const helpinforecordsDetails = (params) => getAction('/mini/wb/helpinforecords/details', params)
export const deviceeventDetails = (params) => getAction('/mini/wb/deviceevent/details', params)

export const deviceinfoHome = (params) => getAction('/mini/wb/deviceinfo/home', params)

export const deviceinfoTrajectory = (params) => getAction('/mini/wb/deviceinfo/trajectory', params)

export const helpinfoBingding = (params) => postAction('/mini/wb/helpinfo/bingding', params)

export const wbHttpFences = (params) => postAction('/web/wb/wbHttp/fences', params)

export const addWbMorbidityRecords = (params) => postAction('/mini/wb/wbmorbidityrecords/addWbMorbidityRecords', params)
export const gethotelStayPersonInfo = (params) => getAction('/mini/featured/tenant/gethotelStayPersonInfo', params)
export const editAuthentication = (params) => postAction('mini/user/Authentication/editAuthentication', params)
export const deviceMessageReminder = params => getAction('mini/wb/deviceevent/messageReminder', params)
export const feedbackAdd = params => postAction('/feedback/add', params)
export const feedbackDetail = params => getAction('/feedback/detail', params)
export const missingAddressReporting = params => postAction('/missingAddressReporting/add', params)
export const missingAddressReportingJurisdictionList = params => getAction('/missingAddressReporting/jurisdictionList',
  params)
export const missingAddressReportingJurisdictionDetail = params => getAction(
  '/missingAddressReporting/detail',
  params)

export const aerocraftAdd = params => postAction('/dsSyAerocraft/aerocraftAdd', params)
export const getAerocraftIdInfo = params => getAction('/dsSyAerocraft/getAerocraftIdInfo', params)
export const dogAdd = params => postAction('/dsSyDog/dogAdd', params)
export const getDogIdInfo = params => getAction('/dsSyDog/getDogIdInfo', params)

export const dsSyCarAdd = params => postAction('/dsSyCar/dsSyCarAdd', params)
export const getdsSyCarIdInfo = params => getAction('/dsSyCar/getdsSyCarIdInfo', params)

export const toolAdd = params => postAction('/dsSyQtwp/toolAdd', params)
export const getToolId = params => getAction('/dsSyQtwp/getToolId', params)

export const dsSySlingshotAdd = params => postAction('/dsSySlingshot/dsSySlingshotAdd', params)
export const getdsSySlingshotIdInfo = params => getAction('/dsSySlingshot/getdsSySlingshotIdInfo', params)

export const dsSyGastankAdd = params => postAction('/dsSyGastank/dsSyGastankAdd', params)
export const getdsSyGastankIdInfo = params => getAction('/dsSyGastank/getdsSyGastankIdInfo', params)

export const dsSyCowAdd = params => postAction('/dsSyCow/dsSyCowAdd', params)
export const getdsSyCowIdInfo = params => getAction('/dsSyCow/getdsSyCowIdInfo', params)

export const dsSyNjjAdd = params => postAction('/dsSyNjj/dsSyNjjAdd', params)
export const getdsSyNjjIdInfo = params => getAction('/dsSyNjj/getdsSyNjjIdInfo', params)

export {
  userDecrypt,
  wxLogin,
  findEnableDictItemsbyCode,
  findAllDict,
  logout,
  editPWD,
  userCheckPic,
  getRed,
};